// 引入Service和请求头ServiceName
import { Service, ServiceName } from '@/network/http.js'
import store from '@/store/index.js' // 引入store

const api = {
  // 查询主列表数据
  queryPlanType (params) {
    return Service.get(
      `/${ServiceName}/api/external/SecondryDispenser/queryPlanType`,{params}
    )
  },
  // 查询转运数据
  queryTransportPlan (params) {
    return Service.get(
      `/${ServiceName}/api/external/workPlan/queryTransportPlan`,{params}
    )
  },
  // 查询表中设备类型名称 deptId companyId
  queryEquipment (params) {
    return Service.get(
      `/${ServiceName}/api/external/SecondryDispenser/queryEquipment`,{params}
    )
  },
  // 查询司机 部门code 组织结构/外部公司
  queryDriver (params) {
    return Service.post(
      `/${ServiceName}/api/external/SecondryDispenser/queryDriver`, params
    )
  },
  // 新增机械配工
  insert (params) {
    store.commit('changeStatus', true)
    return Service.post(
      `/${ServiceName}/api/external/SecondryDispenser/insert`,params
    )
  },
  // 查询机械配工
  queryMechanicalDispatch (params) {
    return Service.get(
      `/${ServiceName}/api/external/SecondryDispenser/queryMechanicalDispatch?id=${params}`
    )
  },
  // 查询全部机械配工
  queryMechanicalDispatchAll (params) {
    return Service.get(
      `/${ServiceName}/api/external/SecondryDispenser/queryMechanicalDispatchAll?id=${params}`
    )
  },
  // 编辑机械配工
  updatebyid (params) {
    store.commit('changeStatus', true)
    return Service.put(
      `/${ServiceName}/api/external/SecondryDispenser/updatebyid`,params
    )
  },
  // 获取所选机械
  querySplicing (params) {
    return Service.get(
      `/${ServiceName}/api/external/SecondryDispenser/querySplicing?id=${params}`
    )
  },
  // 查询劳务人员 部门id集合
  queryLaborByDeptId (params) {
    return Service.post(
      `/${ServiceName}/api/external/SecondryDispenser/queryLaborByDeptId`,params
    )
  },
  // 查询已派劳务人员
  queryById (params) {
    return Service.get(
      `/${ServiceName}/api/external/SecondryDispenser/queryById`,{params}
    )
  },
  // 新增修改派劳务人员
  insertLabor (params) {
    store.commit('changeStatus', true)
    return Service.post(
      `/${ServiceName}/api/external/SecondryDispenser/insertLabor`,params
    )
  },
  // 查询熏蒸管理员
  queryPeople (params) {
    return Service.post(
      `/${ServiceName}/api/external/SecondryDispenser/queryPeople`,params
    )
  },
  // 新增修改熏蒸管理员
  insertFum (params) {
    store.commit('changeStatus', true)
    return Service.post(
      `/${ServiceName}/api/external/SecondryDispenser/insertFum`,params
    )
  },
  // 查询全部劳务或熏蒸
  queryAllById (params) {
    return Service.get(
      `/${ServiceName}/api/external/SecondryDispenser/queryAllById`,{params}
    )
  },
}
export default api